<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <input type="text" id="strInput">
    <input type="button" value="小写变大写" id="button1">
    <input type="button" value="大写变小写" id="button2">
    <script>
    let strInput = document.getElementById('strInput');
    button1.onclick = function(){
        let strInput = document.getElementById('strInput');
        let str =strInput.value;
        str = str.toUpperCase();
        strInput.value=str;
        
    }
     let strInput = document.getElementById('strInput');
    button2.onclick = function(){
        let strInput = document.getElementById('strInput');
        let str =strInput.value;
        str = str.tolpperCase();
        strInput.value=str;
    }
    </script>
</body>
</html>